/* eslint-disable sort-keys */
import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';

const sidebars: SidebarsConfig = {
	docs: [
		'intro',
		'install',
		{
			type: 'category',
			label: 'How it works',
			collapsed: true,
			collapsible: true,
			items: [
				'how-it-works/languages',
				'how-it-works/project-graph',
				'how-it-works/task-graph',
				'how-it-works/action-graph',
			],
			link: {
				type: 'generated-index',
				title: 'How it works',
				slug: '/how-it-works',
				keywords: [
					'how',
					'works',
					'mental-model',
					'languages',
					'project-graph',
					'action-graph',
					'dep-graph',
					'dependency-graph',
					'task-graph',
				],
			},
		},
		{
			type: 'category',
			label: 'Getting started',
			collapsed: false,
			collapsible: true,
			items: [
				'setup-workspace',
				'create-project',
				'setup-toolchain',
				'create-task',
				'run-task',
				'migrate-to-moon',
			],
		},
		{
			type: 'category',
			label: 'Concepts',
			items: [
				'concepts/cache',
				'concepts/file-group',
				'concepts/file-pattern',
				'concepts/query-lang',
				'concepts/project',
				'concepts/target',
				'concepts/task',
				'concepts/task-inheritance',
				'concepts/token',
				'concepts/toolchain',
				'concepts/workspace',
			],
			link: {
				type: 'generated-index',
				title: 'Concepts',
				slug: '/concepts',
				keywords: ['concepts'],
			},
		},
		{
			type: 'category',
			label: 'Config files',
			items: [
				'config/workspace',
				'config/toolchain',
				'config/tasks',
				'config/project',
				'config/template',
			],
			link: {
				type: 'generated-index',
				title: 'Config files',
				slug: '/config',
				keywords: ['config'],
			},
		},
		{
			type: 'category',
			label: 'Editors',
			items: ['editors/vscode'],
			link: {
				type: 'generated-index',
				title: 'Editors',
				slug: '/editors',
				keywords: ['editors', 'vscode'],
			},
		},
		{
			type: 'category',
			label: 'Commands',
			items: [
				'commands/overview',
				'commands/action-graph',
				'commands/bin',
				'commands/check',
				'commands/ci',
				'commands/clean',
				'commands/completions',
				{
					type: 'category',
					label: 'docker',
					items: [
						'commands/docker/file',
						'commands/docker/prune',
						'commands/docker/scaffold',
						'commands/docker/setup',
					],
					link: {
						type: 'generated-index',
						title: 'docker',
						description: 'Operations for integrating with Docker and Dockerfiles.',
						slug: '/commands/docker',
						keywords: ['cli', 'commands', 'docker'],
					},
				},
				'commands/ext',
				'commands/generate',
				'commands/init',
				{
					type: 'category',
					label: 'migrate',
					items: ['commands/migrate/from-package-json', 'commands/migrate/from-turborepo'],
					link: {
						type: 'generated-index',
						title: 'migrate',
						description: 'Operations for migrating existing projects to moon.',
						slug: '/commands/migrate',
						keywords: ['cli', 'commands', 'migrate'],
					},
				},
				'commands/mcp',
				'commands/project',
				'commands/project-graph',
				{
					type: 'category',
					label: 'query',
					items: [
						'commands/query/hash',
						'commands/query/hash-diff',
						'commands/query/projects',
						'commands/query/tasks',
						'commands/query/touched-files',
					],
					link: {
						type: 'generated-index',
						title: 'query',
						description:
							'Query information about moon, its projects, their tasks, the environment, the pipeline, and many other aspects of the workspace.',
						slug: '/commands/query',
						keywords: ['cli', 'commands', 'query'],
					},
				},
				'commands/run',
				'commands/setup',
				{
					type: 'category',
					label: 'sync',
					items: [
						'commands/sync/codeowners',
						'commands/sync/config-schemas',
						'commands/sync/hooks',
						'commands/sync/projects',
					],
					link: {
						type: 'generated-index',
						title: 'sync',
						description: 'Operations for syncing the workspace to a healthy state.',
						slug: '/commands/sync',
						keywords: ['sync', 'codeowners', 'projects'],
					},
				},
				'commands/task',
				'commands/task-graph',
				'commands/teardown',
				'commands/templates',
				{
					type: 'category',
					label: 'toolchain',
					items: ['commands/toolchain/add', 'commands/toolchain/info'],
					link: {
						type: 'generated-index',
						title: 'toolchain',
						description: 'Manage toolchain plugins.',
						slug: '/commands/toolchain',
						keywords: ['manage', 'toolchain', 'plugins'],
					},
				},
				'commands/upgrade',
			],
			link: {
				type: 'generated-index',
				title: 'Commands',
				slug: '/commands',
				keywords: ['cli', 'commands'],
			},
		},
		'cheat-sheet',
		'comparison',
		'terminology',
		'faq',
		{
			type: 'link',
			label: 'Changelog',
			href: 'https://github.com/moonrepo/moon/releases',
		},
	],

	guides: [
		'guides/ci',
		'guides/codegen',
		'guides/codeowners',
		'guides/debug-task',
		'guides/docker',
		'guides/extensions',
		'guides/mcp',
		'guides/offline-mode',
		'guides/open-source',
		'guides/pkl-config',
		'guides/remote-cache',
		'guides/root-project',
		'guides/sharing-config',
		'guides/notifications',
		'guides/wasm-plugins',
		'guides/webhooks',
		'guides/vcs-hooks',
		{
			type: 'html',
			value: '<hr />',
			defaultStyle: true,
		},
		{
			type: 'category',
			label: 'JavaScript',
			collapsed: false,
			items: [
				'guides/javascript/bun-handbook',
				'guides/javascript/deno-handbook',
				'guides/javascript/node-handbook',
				'guides/profile',
				'guides/javascript/typescript-project-refs',
				{
					type: 'category',
					label: 'Examples',
					collapsed: true,
					collapsible: true,
					items: [
						'guides/examples/angular',
						'guides/examples/astro',
						'guides/examples/eslint',
						'guides/examples/jest',
						'guides/examples/nest',
						'guides/examples/next',
						'guides/examples/nuxt',
						'guides/examples/packemon',
						'guides/examples/prettier',
						'guides/examples/react',
						'guides/examples/remix',
						'guides/examples/solid',
						'guides/examples/storybook',
						'guides/examples/sveltekit',
						'guides/examples/typescript',
						'guides/examples/vite',
						'guides/examples/vue',
					],
					link: {
						type: 'generated-index',
						title: 'Node.js examples',
						slug: '/guides/node/examples',
						keywords: ['node', 'javascript', 'typescript', 'guides', 'examples', 'tools'],
					},
				},
			],
		},
		{
			type: 'html',
			value: '<hr />',
			defaultStyle: true,
		},
		{
			type: 'category',
			label: 'Rust',
			collapsed: false,
			items: ['guides/rust/handbook'],
		},
	],

	proto: [
		'proto/index',
		'proto/install',
		'proto/workflows',
		'proto/config',
		'proto/tool-spec',
		'proto/detection',
		'proto/tools',
		{
			type: 'category',
			label: 'Plugins',
			link: { type: 'doc', id: 'proto/plugins' },
			items: ['proto/wasm-plugin', 'proto/non-wasm-plugin'],
		},
		{
			type: 'category',
			label: 'Commands',
			items: [
				'proto/commands/activate',
				'proto/commands/alias',
				'proto/commands/bin',
				'proto/commands/clean',
				'proto/commands/completions',
				{
					type: 'category',
					label: 'debug',
					items: ['proto/commands/debug/config', 'proto/commands/debug/env'],
					link: {
						type: 'generated-index',
						title: 'debug',
						description: 'Operations for debugging the current proto environment.',
						slug: '/proto/commands/debug',
						keywords: ['cli', 'commands', 'debug'],
					},
				},
				'proto/commands/diagnose',
				'proto/commands/exec',
				'proto/commands/install',
				'proto/commands/outdated',
				'proto/commands/pin',
				{
					type: 'category',
					label: 'plugin',
					items: [
						'proto/commands/plugin/add',
						'proto/commands/plugin/info',
						'proto/commands/plugin/list',
						'proto/commands/plugin/remove',
						'proto/commands/plugin/search',
					],
					link: {
						type: 'generated-index',
						title: 'plugin',
						description: 'Operations for managing tools and plugins.',
						slug: '/proto/commands/plugin',
						keywords: ['cli', 'commands', 'tool', 'plugin'],
					},
				},
				'proto/commands/regen',
				'proto/commands/run',
				'proto/commands/setup',
				'proto/commands/status',
				'proto/commands/unalias',
				'proto/commands/uninstall',
				'proto/commands/unpin',
				'proto/commands/upgrade',
				'proto/commands/versions',
			],
		},
		'proto/faq',
		{
			type: 'link',
			label: 'Changelog',
			href: 'https://github.com/moonrepo/proto/releases',
		},
	],
};

export default sidebars;
